cmake_minimum_required(VERSION 2.6)
project(curve_fit)

find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
link_libraries(${OpenCV_LIBRARY_DIRS})

list(APPEND CMAKE_MODULE_PATH  /home/likun/bag/g2o-master/cmake_modules)
#set(G2O_ROOT  /home/likun/bag/g2o-master)
find_package(G2O REQUIRED)
include_directories(${G2O_INCLUDE_DIRS} "/usr/local/include/eigen3")

find_package(Ceres REQUIRED)
include_directories(${CERES_INCLUDE_DIRS})
link_directories(${CERES_LIBRARY_DIRS})

add_executable(curve_fit main.cpp)

target_link_libraries(curve_fit ${OpenCV_LIBS} ${CERES_LIBS})

target_link_libraries(curve_fit g2o_core g2o_types_slam3d g2o_solver_csparse g2o_stuff g2o_csparse_extension)

install(TARGETS curve_fit RUNTIME DESTINATION bin)
